home *** CD-ROM | disk | FTP | other *** search
- // jot1.js
- // A simple Windows JScript script demonstrating Jot+ Notes' Automation
- // interfaces. It loads a notefile (filename hard-coded) and prints the
- // titles of every note.
- // usage: cscript jot1.js
- // You will need to update the jotApp.Load line appropriately
-
- var jotApp = new ActiveXObject("JotPlus.JotApplication");
- jotApp.Visible = false;
-
- // PrintNote
- // Recursively prints a note's details
- function PrintNote(note)
- {
- // Print this note's ID and Title:
- WScript.StdOut.WriteLine( note.ID + ': '+note.Title );
-
- // Now iterate over this note's children to print them:
- var e = new Enumerator(note.Children);
- for (;!e.atEnd();e.moveNext())
- {
- PrintNote( e.item() );
- }
- }
-
- // Load a sample notefile:
- jotApp.Load( "z:\\jot\\holmes.jot3", true );
-
- // Display some details about the notefile:
- var doc = jotApp.ActiveDocument;
- WScript.StdOut.WriteLine( "Filename: "+doc.FullName);
- WScript.StdOut.WriteLine( "Title: "+doc.Title);
-
- // Now display the titles of all notes:
- PrintNote( doc.Root );
-
- WScript.StdOut.WriteLine( "DONE." );
-